/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.customer.core.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import info.peigen.hotpot.business.customer.facade.enums.partner.PartnerStatus;
import info.peigen.hotpot.component.data.repository.beetlsql.entity.AbstractCreateTimeWithoutPartnerIdEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

/**
 * <b>(PartnerEntity)</b>
 * 合作伙伴表
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/1
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "partner", comment = "合作伙伴表", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "partner")
public class PartnerEntity extends AbstractCreateTimeWithoutPartnerIdEntity {
    @Column(name = "partner_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "合作伙伴Id")
    @Unique(value = "partnerId", columns = "partner_id")
    @org.beetl.sql.annotation.entity.Column("partner_id")
    String        partnerId;
    @Column(name = "abbreviation", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "合作伙伴缩写")
    @org.beetl.sql.annotation.entity.Column("abbreviation")
    String        abbreviation;
    @Column(name = "partner_name", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "合作伙伴名字")
    @Unique(value = "partnerName", columns = "partner_name")
    @org.beetl.sql.annotation.entity.Column("partner_name")
    String        partnerName;
    @Column(name = "status", type = MySqlTypeConstant.VARCHAR, length = 20, isNull = false,
            comment = "状态;INIT:初始化, NORMAL:正常客户, FREEZE:被冻结, UN_SUBSCRIBE:被注销")
    @Index(value = "status", columns = "status")
    @org.beetl.sql.annotation.entity.Column("status")
    PartnerStatus status;
    @Column(name = "permission", type = MySqlTypeConstant.JSON, comment = "合作伙伴权限")
    @org.beetl.sql.annotation.entity.Column("permission")
    String        permission;
    @Column(name = "tech", type = MySqlTypeConstant.JSON, comment = "技术相关;合作伙伴模块与技术相关的内容")
    @org.beetl.sql.annotation.entity.Column("tech")
    String        tech;
    @Column(name = "memo", type = MySqlTypeConstant.VARCHAR, length = 200, comment = "备注")
    @org.beetl.sql.annotation.entity.Column("memo")
    String        memo;
}